﻿@page
@model LoginModel
@{
    ViewData["PageName"] = "login";
}

@section Header {
    <link rel="stylesheet" media="screen, print" href="~/css/fa-brands.css">
}

@section PageHeading {

}

<div class="col-sm-12 col-md-6 col-lg-5 col-xl-4 m-auto">
    <h1 class="text-white fw-300 mb-3 d-sm-block d-md-none">
        登录
    </h1>
    <div class="card p-4 rounded-plus bg-faded">
        <form id="js-login"  asp-antiforgery="false"  method="post">
            <div asp-validation-summary="All" class="alert alert-primary text-dark"></div>
            <div class="form-group">
                <label class="form-label" asp-for="Input.UserName">用户名</label>
                <input type="text" asp-for="Input.UserName" class="form-control" placeholder="Email for verification" value="demo" required="required" />
                <span class="invalid-feedback" asp-validation-for="Input.UserName">请输入用户名或邮件地址.</span>
                <div class="help-block">注册的用户名或邮件地址</div>
            </div>
            <div class="form-group">
                <label class="form-label" asp-for="Input.Password">密码</label>
                <input type="password" asp-for="Input.Password" class="form-control" placeholder="Your password" value="" required="required" />
                <span class="invalid-feedback" asp-validation-for="Input.Password">请输入有效的密码.</span>
                <div class="help-block">您在注册时指定的密码</div>
            </div>
            <div class="form-group text-left">
                <div class="custom-control custom-checkbox">
                    <input type="checkbox" class="custom-control-input" asp-for="Input.RememberMe" />
                    <label class="custom-control-label" asp-for="Input.RememberMe">在接下来的30天里，请记住我</label>
                </div>
            </div>
            <div class="row no-gutters">
          
                <div class="col-lg-6 pl-lg-1 my-2 ml-auto">
                    <button id="js-login-btn" type="submit" class="btn btn-danger btn-block ">登录</button>
                </div>
            </div>
            <div class="text-center">
                <a asp-page="ForgotPassword" class="opacity-90">忘记了你的密码?</a>
            </div>
        </form>
    </div>
</div>

@section Scripts {
    <partial name="_ValidationScriptsPartial" />
    <script>
        $("#js-logsin-btn").click(function (event) {
            // Fetch form to apply custom Bootstrap validation
            var form = $("#js-login");

            if (form[0].checkValidity() === false) {
                event.preventDefault();
                event.stopPropagation();
            }

            form.addClass('was-validated');
            // Perform ajax submit here...
        });
    </script>
}
